<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('zhjy_repots', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('日报Id')->primary();
            $table->unsignedBigInteger('user_id')->comment('所属用户ID');
            $table->integer('recordType')->comment('日志类型: 1日报、2周报、3月报');
            $table->longText('todaySummary')->comment('本周计划');
            $table->longText('nextSummary')->comment('下周计划');
            $table->longText('feedback')->comment('反馈问题')->nullable();
            $table->integer('selfEvaluate')->comment('自我评价 1一般 2 良好 3优秀 4 尚需努力')->default(2);
            $table->longText('fileId')->comment('文件Id，多个文件用逗号隔开')->nullable();
            $table->string('filePath')->comment('数据文件地址')->nullable();
            $table->string('fileName')->comment('数据文件名')->nullable();
            $table->integer('isdelete')->comment('1 存在 2 过期')->default(1);
            $table->timestamps();

              // 添加索引
              $table->index('user_id');
              $table->index('recordType');
              $table->index('selfEvaluate');
              $table->index('isdelete');
              $table->index('created_at');
              $table->index('filePath');
        });

          
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('zhjy_repots');
    }
};
